const Router = require('koa-router')
const { auth } = require('../middle/auth')
const router = new Router({
  prefix: '/question/:questionId/answer/:answerId/comment'
})

const {getCommentList, isCommentExist, findCommentById, addComment, deleteQuestion } = require('../controllers/comment')

router.get('/', getCommentList) // 评论列表

router.get('/:commentId',isCommentExist, findCommentById) // 某一评论

router.delete('/:commentId', auth, isCommentExist, deleteQuestion) // 删除评论

router.post('/', auth, addComment) // 发表评论



module.exports = router